package org.springframework.amqp.tutorials.config.topic;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

//所有人
@Component
@RabbitListener(queues = "people")
public class PeopleTopicReceiver {

    @RabbitHandler
    public void receiverMsg(String msg) throws ExecutionException, InterruptedException, TimeoutException {
        CorrelationData cd1 = new CorrelationData();
        System.out.println("管理员收到所有信息：" + msg);
    }
}